#ifndef _CPATCHPLOT_H_
#define _CPATCHPLOT_H_

#include <buola/chart/plots/cxyplot.h>

#include <buola/image/ccolor.h>
#include <buola/chart/evaluemapper.h>
#include <buola/chart/cseries.h>
#include <buola/mat.h>

namespace buola { namespace chart {

class CPatchPlot : public CXYPlot
{
public:
    CPatchPlot();
    virtual ~CPatchPlot();

public:
/////////////// interface /////////////////
    void SetData(const mat::CMat_d &pSeries);

    void SetColorMapper(EValueMapper<double,img::CColor> *pMapper);

    double GetMinX();
    double GetMaxX();
    double GetMinY();
    double GetMaxY();
    CRect_d GetExtraSpace();

    void Draw(CXYChartContext &pC);

protected:
/////////////////// properties ////////////////////
    mat::CMat_d mSeries;

    std::unique_ptr<EValueMapper<double,img::CColor>> mColorMapper;
};

/*namespace chart*/ } /*namespace buola*/ }

#endif
